pragma encoding, "UTF-8"
pragma runLim, 0
void saveData(DB win){
//Here I need to get the element(Number) from the current window(Window), is this possible?
string s = get(win,Number)
print s"\n"
}
void closeWin(DB win){
hide(win)
destroy(win)
}
// This function shows the new SVN window
void initWindow(){
DB Window = null
DBE Number = null
DBE Location = null
//Object thisObj = current(crMod)
Window = centered("Number - Location - Data")
Number = text(Window, "Number:", "",100, 20,false)
Number ->"right" -> "unattached"
Number ->"top"->"form"
Location = text(Window, "Location:", "",500, 20,false)
Location ->"left" -> "spaced"->Number
Location ->"top" -> "aligned"->Number
Location ->"top"->"form"
apply(Window, "Save", saveData)
close(Window,true, closeWin)
realize Window
}
initWindow()
SystemAdmin - Thu Nov 11 13:25:44 EST 2010 |
Re: Get Elements Values Using Function with Local Variables You should routinely declare your DB and DBE variables near the top of your code in the main context. This allows your various callback functions the ability to deal with them.
pragma encoding, "UTF-8"
pragma runLim, 0
DB Window = null // Routinely declare DB and DBEs at the top in the main code
DBE Number = null
DBE Location = null
void saveData(DB win){
//Here I need to get the element(Number) from the current window(Window), is this possible?
string s = get(Number) // <<==Get the Number from the DBE
print s "\n"
}
void closeWin(DB win){
hide(win)
destroy(win)
}
// This function shows the new SVN window
void initWindow(){
//Object thisObj = current(crMod)
Window = centered("Number - Location - Data")
Number = text(Window, "Number:", "",100, 20,false)
Number ->"right" -> "unattached"
Number ->"top" ->"form"
Location = text(Window, "Location:", "",500, 20,false)
Location ->"left" -> "spaced"->Number
Location ->"top" -> "aligned"->Number
Location ->"top" ->"form"
apply(Window, "Save", saveData)
close(Window,true, closeWin)
realize Window
}
initWindow()
|